

#historic analysis
def historic_analysis2():
	#dyrus - 1900+ elo id: 5908
	ml_low = MatchList("27365916")
	ml_mid = MatchList("19759992")
	ml_high = MatchList("5908")
	ml_low2 = MatchList("21854139")
	ml_low2.update(True)

	correct = 0
	guesses = 0
	total_games = 0
	for m in ml_low2.data["matches"]+ml_low.data["matches"]+ml_mid.data["matches"]+ml_high.data["matches"]:
		teams = m["team"]
		#print m["outcome"]
		if m["outcome"] == "win": outcome = 0
		else: outcome = 1
		ally_champs, enemy_champs = [], []
		for i, t in enumerate([teams["allies"], teams["enemies"]]):
			total = 0
			for p in t:
				if i == 0:
					ally_champs.append(p[0])
				else:
					enemy_champs.append(p[0])
				_sum = Summoner(p[1], True, True)
			 	ranking = _sum.auto_analysis()
			 	#print ranking[get_role(p[0])], p[1], _sum.get_name(), get_role(p[0]), p[0]
			 	total += ranking[get_role(p[0])]
			if i == 0:
				a_ranking = total
			else:
				e_ranking = total
		#res = get_counter_score(ally_champs, enemy_champs)
		#print res[0], res[1]
		#print "\n"

		total_games += 1

		diff = abs(a_ranking - e_ranking)
		if not a_ranking > -0.0:
			continue
		guesses += 1
		if outcome == 0:
			correct += 1
		#if a_ranking < e_ranking and outcome == 1:
			#correct += 1
		print a_ranking, e_ranking, m["outcome"]
	print correct/float(guesses), guesses/float(total_games), total_games